#include "GDevice.h"

namespace GEngine
{
	GDevice::GDevice(GModule* Owner, void* Handle)
	{
		Enabled = true;
		Connected = false;
		
		OwnerModule = Owner;
		DeviceHandle = Handle;
	}
	
	GDevice::~GDevice()
	{
	}

	void GDevice::SetEnabled(bool Value)
	{
		Enabled = Value;
	}

	bool GDevice::GetEnabled() const
	{
		return Enabled;
	}

	void GDevice::SetConnected(bool Value)
	{
		Connected = Value;
	}

	bool GDevice::GetConnected() const
	{
		return Connected;
	}

	void* GDevice::GetDeviceHandle() const
	{
		return DeviceHandle;
	}

	GModule* GDevice::GetOwnerModule() const
	{
		return OwnerModule;
	}

	GUInt32 GDevice::GetType() const
	{
		return G_DT_OTHER;
	}

	const char* GDevice::GetName() const
	{
		return "UnnamedDevice";
	}

	void GDevice::Reset()
	{
	}

	bool GDevice::Update()
	{
		if (Connected && Enabled)
		{
			return true;
		}

		return false;
	}

	bool GDevice::operator==(const GDevice& Other) const
	{
		return Other.DeviceHandle == DeviceHandle;
	}
}